Skip to content

fix(audit): detect the dcgm-exporter Service on Slurm on Kubernetes - #35

Open
robTheBuildr wants to merge 1 commit into
SemiAnalysisAI:masterfrom
robTheBuildr:roblevy/dcgm-exporter-k8s-service
Open

robTheBuildr wants to merge 1 commit into
SemiAnalysisAI:masterfrom
robTheBuildr:roblevy/dcgm-exporter-k8s-service

Conversation

@robTheBuildr

@robTheBuildr robTheBuildr commented Oct 8, 2026 •

Copy link
Copy Markdown

Fixes #33.

Changes

  • If the port and systemd checks do not find dcgm-exporter, and /etc/resolv.conf has Kubernetes cluster search domains, the Slurm collector queries the GPU Operator exporter Service: http://nvidia-dcgm-exporter.gpu-operator.svc:9400/metrics. The exporter counts only if the response has DCGM_FI_ metrics. The query has a 5 s time limit.
  • The check reads resolv.conf, not KUBERNETES_SERVICE_HOST. The audit can run in a su - login shell, and that shell drops the variable.
  • CLUSTERMAX_DCGM_EXPORTER_URL sets a different URL, for another namespace or exporter. When it is set, the collector queries that URL with no resolv.conf check.
  • A bare-metal head node sends no query. The report line names the URL that supplied the metrics.
  • CLUSTERMAX_RESOLV_CONF sets the resolv.conf path. The tests use it so that the host resolv.conf does not change the results.

Tests

  • tests/audit/test_monitoring_process_detection.py, 5 new tests:
    • a Service with DCGM metrics is detected, and the report names the URL;
    • a response with no DCGM metrics is not detected;
    • an unreachable Service is not detected;
    • a bare-metal resolv.conf sends no query;
    • the URL override is queried.
  • Audit suite: 1,317 passed, 9 skipped. The same unrelated test fails as on unchanged master.
  • Live: on a GB300 Slurm on Kubernetes cluster, the collector block ran as the Slurm user in the login pod. It printed dcgm-exporter: detected (DCGM metrics at http://nvidia-dcgm-exporter.gpu-operator.svc:9400/metrics).
  • git diff --check passed.

Limits

The check shows that the Service serves DCGM metrics. It does not show that all GPU nodes run an exporter, or that Prometheus scrapes it. The standalone collector does not change.


Note

Low Risk
Audit-only monitoring detection with optional outbound HTTP to a configurable metrics URL; no changes to Slurm job control or cluster configuration.

Overview
Extends Slurm cluster audit monitoring detection so dcgm-exporter is found on Slurm-on-Kubernetes head/login pods where the exporter runs as a GPU Operator DaemonSet behind a Service, not on :9400 or as a local systemd unit.

When port/systemd checks miss it, the script may curl a metrics URL (5s timeout) and treats the exporter as present only if the body includes DCGM_FI_ lines. On Kubernetes it infers a pod from resolv.conf search domains (*.svc.) and defaults to http://nvidia-dcgm-exporter.gpu-operator.svc:9400/metrics; CLUSTERMAX_DCGM_EXPORTER_URL forces a custom URL without that check, and CLUSTERMAX_RESOLV_CONF points at resolv for tests. Bare-metal resolv skips the HTTP probe. The report line now cites how detection succeeded (port/systemd vs metrics URL).

Adds five behavioral tests in test_monitoring_process_detection.py for pod detection, non-DCGM/unreachable responses, no curl on host resolv, and URL override.

Reviewed by Cursor Bugbot for commit 267bb62. Bugbot is set up for automated code reviews on this repo. Configure here.

On Slurm on Kubernetes the head node is a pod. The GPU Operator runs
dcgm-exporter as a DaemonSet in other pods on the GPU nodes, so the head
node has no listener on :9400, no systemd unit and no process. The audit
reported "DCGM exporter not installed" on a cluster with 18 of 18 exporter
pods ready.

When the local checks find nothing and resolv.conf has cluster search
domains, query the GPU Operator exporter Service and count it only when it
serves DCGM_FI_ metrics. The check reads resolv.conf because `su -` login
shells drop KUBERNETES_SERVICE_HOST. CLUSTERMAX_DCGM_EXPORTER_URL sets the
URL for other namespaces or exporters. Bare-metal head nodes do not query.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slurm audit does not detect dcgm-exporter when Slurm runs on Kubernetes

1 participant